<template>
  <header class='header'>
    <div class="container">
      <h1 class="logo">
        <RouterLink to="/">龙卷风书城</RouterLink>
      </h1>
      <HeaderNav/>
      <div class="search">
        <i class="iconfont icon-search"></i>
        <input type="text" placeholder="找找喜欢的书吧！">
      </div>
      <div class="cart">
        <RouterLink class="curr" to="cart">
          <i class="iconfont icon-cart"></i><em>2</em>
        </RouterLink>
      </div>
    </div>
  </header>
</template>

<script>
import HeaderNav from './header-nav.vue';

export default {
    name: "Header",
    components: { HeaderNav }
}
</script>

<style scoped lang='less'>
.header {
  background: #fff;

  .container {
    display: flex;
    align-items: center;
  }

  .logo {
    width: 200px;

    a {
      display: block;
      height: 132px;
      width: 100%;
      text-indent: -9999px;
      background: url(../assets/images/logo.png) no-repeat center  / contain;
    }
  }
  .search {
    width: 170px;
    height: 32px;
    position: relative;
    border: 1px solid #9d0ce0;
    line-height: 32px;
    box-shadow: 10px 5px 5px #0a92cd;
    .icon-search {
      font-size: 18px;
      margin-left: 5px;
    }

    input {
      width: 140px;
      padding-left: 5px;
      color: #666;
    }
  }

  .cart {
    width: 50px;
    padding-left: 22px;

    .curr {
      height: 32px;
      line-height: 32px;
      text-align: center;
      position: relative;
      display: block;

      .icon-cart {
        font-size: 22px;
      }

      em {
        font-style: normal;
        position: absolute;
        right: 0;
        top: 0;
        padding: 1px 6px;
        line-height: 1;
        background: @helpColor;
        color: #fff;
        font-size: 12px;
        border-radius: 10px;
        font-family: Arial;
      }
    }
  }
}
</style>
